import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.*;

import java.util.stream.Stream;
/**
 * @Author：徐志荣
 * @Date：2023/5/23 18:56
 * 注解
 */

//@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@TestMethodOrder(MethodOrderer.Random.class)
public class JunitTest2 {
    public static Stream<Arguments> Generator() {
        return Stream.of(Arguments.arguments(
                "1,佳佳",
                "2,酷酷"
        ));

    }
    @Order(4)

    @ParameterizedTest
    @ValueSource(ints = {1})
    void Test01(int num){
        System.out.println(num);
      //  Assertions.assertEquals(1,num);
      //  Assertions.assertNotEquals(1,num);
//        String str = "null1";
//        Assertions.assertNull(str);

    }

    @Order(3)

    @ParameterizedTest
    @CsvSource({"1,2,3"})
    void Test02(String  s,String  s2,String  s3){
        System.out.println(s);
        System.out.println(s2);
        System.out.println(s3);
    }
    @Order(1)
    @ParameterizedTest
    @CsvFileSource(resources = "test02.csv")
    void Test03(int num,String name){
        System.out.println("id"+num + " | "+name);
    }
    @Order(2)
    @ParameterizedTest
    @MethodSource("Generator")
    void Test04(String  num,String name){
        System.out.println(num+" ~ "+name);
    }

}
